]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shell-util: Remove shell_util_icon_from_string
authorJasper St. Pierre <jstpierre@mecheye.net>
Fri, 7 Oct 2011 21:35:38 +0000 (17:35 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Tue, 11 Oct 2011 04:07:31 +0000 (00:07 -0400)
GJS doesn't need to be able to represent interfaces for you to be able to
access an interface method, so Gio.icon_new_for_string works fine.

https://bugzilla.gnome.org/show_bug.cgi?id=661231

js/ui/status/power.js
js/ui/telepathyClient.js
src/shell-util.c
src/shell-util.h

index a48aac592d97380c9d297813ebc3711e77196a18..72e47a1eebff61876218dcbb8d3cce0def209b0b 100644 (file)
@@ -155,7 +155,7 @@ Indicator.prototype = {
     _devicesChanged: function() {
         this._proxy.GetRemote('Icon', Lang.bind(this, function(icon, error) {
             if (icon) {
-                let gicon = Shell.util_icon_from_string (icon);
+                let gicon = Gio.icon_new_for_string(icon);
                 this.setGIcon(gicon);
                 this.actor.show();
             } else {
@@ -183,7 +183,7 @@ DeviceItem.prototype = {
         this._box = new St.BoxLayout({ style_class: 'popup-device-menu-item' });
         this._label = new St.Label({ text: this._deviceTypeToString(device_type) });
 
-        this._icon = new St.Icon({ gicon: Shell.util_icon_from_string(icon),
+        this._icon = new St.Icon({ gicon: Gio.icon_new_for_string(icon),
                                    icon_type: St.IconType.SYMBOLIC,
                                    style_class: 'popup-menu-icon' });
 
index 33153660233ae3b6333f5904c3573bb7d2c9b615..7578d5a98ef0185a839474b22f4d8a0956e95094 100644 (file)
@@ -257,7 +257,7 @@ Client.prototype = {
         // FIXME: We don't have a 'chat room' icon (bgo #653737) use
         // system-users for now as Empathy does.
         let source = new ApproverSource(dispatchOp, _("Invitation"),
-                                        Shell.util_icon_from_string('system-users'));
+                                        Gio.icon_new_for_string('system-users'));
         Main.messageTray.add(source);
 
         let notif = new RoomInviteNotification(source, dispatchOp, channel, contacts[0]);
@@ -325,8 +325,8 @@ Client.prototype = {
 
         // We got the TpContact
         let source = new ApproverSource(dispatchOp, _("Call"), isVideo ?
-                                        Shell.util_icon_from_string('camera-web') :
-                                        Shell.util_icon_from_string('audio-input-microphone'));
+                                        Gio.icon_new_for_string('camera-web') :
+                                        Gio.icon_new_for_string('audio-input-microphone'));
         Main.messageTray.add(source);
 
         let notif = new AudioVideoNotification(source, dispatchOp, channel, contacts[0], isVideo);
index a06f99a54ac362834da0d91776faf6da1656ad77..235499509bc4d92bba331cd62d59ab5c04875868 100644 (file)
@@ -395,22 +395,6 @@ shell_util_get_icon_for_uri (const char *text_uri)
   return g_themed_icon_new ("gtk-file");
 }
 
-/**
- * shell_util_icon_from_string:
- * @string: a stringified #GIcon
- *
- * A static method equivalent to g_icon_new_for_string, workaround
- * for GJS not being able to represent Gio.Icon (which is an interface,
- * not a class).
- *
- * Returns: (transfer full): the icon which is represented by @string
- */
-GIcon *
-shell_util_icon_from_string (const char *string, GError **error)
-{
-  return g_icon_new_for_string (string, error);
-}
-
 static void
 stop_pick (ClutterActor       *actor,
            const ClutterColor *color)
index c0d45671eab178b34f29eb14148ee3a990193cd3..b0752ae9781e0dfb91e462aaf59861d3d975e2f4 100644 (file)
@@ -11,8 +11,6 @@ G_BEGIN_DECLS
 
 char    *shell_util_get_label_for_uri          (const char       *text_uri);
 GIcon   *shell_util_get_icon_for_uri           (const char       *text_uri);
-GIcon   *shell_util_icon_from_string           (const char       *string,
-                                                GError          **error);
 
 void     shell_util_set_hidden_from_pick       (ClutterActor     *actor,
                                                 gboolean          hidden);